home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / Emulation_Include_Files / dsound.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  45.0 KB  |  1,016 lines

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) 1995,1996 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:       dsound.h
  6.  *  Content:    DirectSound include file
  7.  *
  8.  **************************************************************************/
  9.  
  10. #ifndef __DSOUND_INCLUDED__
  11. #define __DSOUND_INCLUDED__
  12.  
  13. #undef CreatePalette
  14. #undef GetDC
  15. #undef ReleaseDC
  16.  
  17. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  18. // Guard D3DVALUE and D3DVECTOR definition to make dsound.h
  19. // independent of d3dtypes.h
  20. // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  21. #ifndef DEFINED_D3DVALUE
  22. #define DEFINED_D3DVALUE
  23. #pragma pack(4)
  24.  
  25. /* D3DVALUE is the fundamental Direct3D fractional data type */
  26.  
  27. #define D3DVALP(val, prec) ((float)(val))
  28. #define D3DVAL(val) ((float)(val))
  29. typedef float D3DVALUE, *LPD3DVALUE;
  30.  
  31. #ifdef DRAGON_NODOUBLEMATH
  32. #define D3DDivide(a, b)    (float)((float) (a) / (float) (b))
  33. #else
  34. #define D3DDivide(a, b)    (float)((double) (a) / (double) (b))
  35. #endif
  36. #define D3DMultiply(a, b)    ((a) * (b))
  37.  
  38. #endif //!DEFINED_D3DVALUE
  39.  
  40. #ifndef DEFINED_D3DVECTOR
  41. #define DEFINED_D3DVECTOR
  42.  
  43. #pragma pack(4)
  44.  
  45. typedef struct _D3DVECTOR {
  46.     union {
  47.     D3DVALUE x;
  48.     D3DVALUE dvX;
  49.     };
  50.     union {
  51.     D3DVALUE y;
  52.     D3DVALUE dvY;
  53.     };
  54.     union {
  55.     D3DVALUE z;
  56.     D3DVALUE dvZ;
  57.     };
  58. #if (defined __cplusplus) && (defined D3D_OVERLOADS)
  59.  
  60. public:
  61.  
  62.     // =====================================
  63.     // Constructors
  64.     // =====================================
  65.  
  66.     _D3DVECTOR() { }
  67.     _D3DVECTOR(D3DVALUE f);
  68.     _D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z);
  69.     _D3DVECTOR(const D3DVALUE f[3]);
  70.  
  71.     // =====================================
  72.     // Access grants
  73.     // =====================================
  74.  
  75.     const D3DVALUE&operator[](int i) const;
  76.     D3DVALUE&operator[](int i);
  77.  
  78.     // =====================================
  79.     // Assignment operators
  80.     // =====================================
  81.  
  82.     _D3DVECTOR& operator += (const _D3DVECTOR& v);
  83.     _D3DVECTOR& operator -= (const _D3DVECTOR& v);
  84.     _D3DVECTOR& operator *= (const _D3DVECTOR& v);
  85.     _D3DVECTOR& operator /= (const _D3DVECTOR& v);
  86.     _D3DVECTOR& operator *= (D3DVALUE s);
  87.     _D3DVECTOR& operator /= (D3DVALUE s);
  88.  
  89.     // =====================================
  90.     // Unary operators
  91.     // =====================================
  92.  
  93.     friend _D3DVECTOR operator + (const _D3DVECTOR& v);
  94.     friend _D3DVECTOR operator - (const _D3DVECTOR& v);
  95.  
  96.  
  97.     // =====================================
  98.     // Binary operators
  99.     // =====================================
  100.  
  101.     // Addition and subtraction
  102.         friend _D3DVECTOR operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
  103.         friend _D3DVECTOR operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
  104.     // Scalar multiplication and division
  105.         friend _D3DVECTOR operator * (const _D3DVECTOR& v, D3DVALUE s);
  106.         friend _D3DVECTOR operator * (D3DVALUE s, const _D3DVECTOR& v);
  107.         friend _D3DVECTOR operator / (const _D3DVECTOR& v, D3DVALUE s);
  108.     // Memberwise multiplication and division
  109.         friend _D3DVECTOR operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
  110.         friend _D3DVECTOR operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
  111.  
  112.     // Vector dominance
  113.         friend int operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
  114.         friend int operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
  115.  
  116.     // Bitwise equality
  117.         friend int operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
  118.  
  119.     // Length-related functions
  120.         friend D3DVALUE SquareMagnitude (const _D3DVECTOR& v);
  121.         friend D3DVALUE Magnitude (const _D3DVECTOR& v);
  122.  
  123.     // Returns vector with same direction and unit length
  124.         friend _D3DVECTOR Normalize (const _D3DVECTOR& v);
  125.  
  126.     // Return min/max component of the input vector
  127.         friend D3DVALUE Min (const _D3DVECTOR& v);
  128.         friend D3DVALUE Max (const _D3DVECTOR& v);
  129.  
  130.     // Return memberwise min/max of input vectors
  131.         friend _D3DVECTOR Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
  132.         friend _D3DVECTOR Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
  133.  
  134.     // Dot and cross product
  135.         friend D3DVALUE DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
  136.         friend _D3DVECTOR CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
  137.  
  138. #endif
  139.  
  140. } D3DVECTOR, *LPD3DVECTOR;
  141.  
  142. #endif // !DEFINED_D3DVECTOR
  143.  
  144. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  145.  
  146. #ifdef _WIN32
  147. #define COM_NO_WINDOWS_H
  148. #include <objbase.h>
  149. #endif
  150.  
  151. #define _FACDS  0x878
  152. #define MAKE_DSHRESULT(code)  MAKE_HRESULT(1, _FACDS, code)
  153.  
  154. #ifdef __cplusplus
  155. extern "C" {
  156. #endif // __cplusplus
  157.  
  158. #include "pshpack1.h"   // Assume byte packing throughout
  159.  
  160. #ifndef _WAVEFORMATEX_                // This section added by nigelk
  161. #define _WAVEFORMATEX_
  162. typedef struct
  163. {
  164.     WORD        wFormatTag;         // format type
  165.     WORD        nChannels;          // number of channels (i.e. mono, stereo...)
  166.     DWORD       nSamplesPerSec;     // sample rate
  167.     DWORD       nAvgBytesPerSec;    // for buffer estimation
  168.     WORD        nBlockAlign;        // block size of data
  169.     WORD        wBitsPerSample;     // number of bits per sample of mono data
  170.     WORD        cbSize;             // the count in bytes of the size of
  171.                                     // extra information (after cbSize)
  172. } WAVEFORMATEX, *PWAVEFORMATEX, *LPWAVEFORMATEX;
  173. #endif
  174.  
  175. // Direct Sound Component GUID {47D4D946-62E8-11cf-93BC-444553540000}
  176. DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
  177.  
  178. // DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16}
  179. DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  180.  
  181. #include "poppack.h"        /* Revert to default packing */
  182.  
  183. //
  184. // Structures
  185. // 
  186.  
  187. #ifdef __cplusplus
  188. // 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
  189. struct IDirectSound;
  190. struct IDirectSoundBuffer;
  191. struct IDirectSound3DListener;
  192. struct IDirectSound3DBuffer;
  193. struct IDirectSoundCapture;
  194. struct IDirectSoundCaptureBuffer;
  195. struct IDirectSoundNotify;
  196. #endif // __cplusplus
  197.  
  198. typedef struct IDirectSound *LPDIRECTSOUND;
  199. typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER;
  200. typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER;
  201. typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER;
  202. typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE;
  203. typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER;
  204. typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY;
  205.  
  206. typedef struct _DSCAPS
  207. {
  208.     DWORD           dwSize;
  209.     DWORD           dwFlags;
  210.     DWORD           dwMinSecondarySampleRate;
  211.     DWORD           dwMaxSecondarySampleRate;
  212.     DWORD           dwPrimaryBuffers;
  213.     DWORD           dwMaxHwMixingAllBuffers;
  214.     DWORD           dwMaxHwMixingStaticBuffers;
  215.     DWORD           dwMaxHwMixingStreamingBuffers;
  216.     DWORD           dwFreeHwMixingAllBuffers;
  217.     DWORD           dwFreeHwMixingStaticBuffers;
  218.     DWORD           dwFreeHwMixingStreamingBuffers;
  219.     DWORD           dwMaxHw3DAllBuffers;
  220.     DWORD           dwMaxHw3DStaticBuffers;
  221.     DWORD           dwMaxHw3DStreamingBuffers;
  222.     DWORD           dwFreeHw3DAllBuffers;
  223.     DWORD           dwFreeHw3DStaticBuffers;
  224.     DWORD           dwFreeHw3DStreamingBuffers;
  225.     DWORD           dwTotalHwMemBytes;
  226.     DWORD           dwFreeHwMemBytes;
  227.     DWORD           dwMaxContigFreeHwMemBytes;
  228.     DWORD           dwUnlockTransferRateHwBuffers;
  229.     DWORD           dwPlayCpuOverheadSwBuffers;
  230.     DWORD           dwReserved1;
  231.     DWORD           dwReserved2;
  232. } DSCAPS, *LPDSCAPS;
  233.  
  234. typedef const DSCAPS *LPCDSCAPS;
  235.  
  236. typedef struct _DSBCAPS
  237. {
  238.     DWORD           dwSize;
  239.     DWORD           dwFlags;
  240.     DWORD           dwBufferBytes;
  241.     DWORD           dwUnlockTransferRate;
  242.     DWORD           dwPlayCpuOverhead;
  243. } DSBCAPS, *LPDSBCAPS;
  244.  
  245. typedef const DSBCAPS *LPCDSBCAPS;
  246.  
  247. typedef struct _DSBUFFERDESC
  248. {
  249.     DWORD           dwSize;
  250.     DWORD           dwFlags;
  251.     DWORD           dwBufferBytes;
  252.     DWORD           dwReserved;
  253.     LPWAVEFORMATEX  lpwfxFormat;
  254. } DSBUFFERDESC, *LPDSBUFFERDESC;
  255.  
  256. typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
  257.  
  258. typedef struct _DS3DBUFFER
  259. {
  260.     DWORD           dwSize;
  261.     D3DVECTOR       vPosition;
  262.     D3DVECTOR       vVelocity;
  263.     DWORD           dwInsideConeAngle;
  264.     DWORD           dwOutsideConeAngle;
  265.     D3DVECTOR       vConeOrientation;
  266.     LONG            lConeOutsideVolume;
  267.     D3DVALUE        flMinDistance;
  268.     D3DVALUE        flMaxDistance;
  269.     DWORD           dwMode;
  270. } DS3DBUFFER, *LPDS3DBUFFER;
  271.  
  272. typedef const DS3DBUFFER *LPCDS3DBUFFER;
  273.  
  274. typedef struct _DS3DLISTENER
  275. {
  276.     DWORD           dwSize;
  277.     D3DVECTOR       vPosition;
  278.     D3DVECTOR       vVelocity;
  279.     D3DVECTOR       vOrientFront;
  280.     D3DVECTOR       vOrientTop;
  281.     D3DVALUE        flDistanceFactor;
  282.     D3DVALUE        flRolloffFactor;
  283.     D3DVALUE        flDopplerFactor;
  284. } DS3DLISTENER, *LPDS3DLISTENER;
  285.  
  286. typedef const DS3DLISTENER *LPCDS3DLISTENER;
  287.  
  288. typedef struct _DSCCAPS
  289. {
  290.     DWORD           dwSize;
  291.     DWORD           dwFlags;
  292.     DWORD           dwFormats;
  293.     DWORD           dwChannels;
  294. } DSCCAPS, *LPDSCCAPS;
  295.  
  296. typedef const DSCCAPS *LPCDSCCAPS;
  297.  
  298. typedef struct _DSCBUFFERDESC
  299. {
  300.     DWORD           dwSize;
  301.     DWORD           dwFlags;
  302.     DWORD           dwBufferBytes;
  303.     DWORD           dwReserved;
  304.     LPWAVEFORMATEX  lpwfxFormat;
  305. } DSCBUFFERDESC, *LPDSCBUFFERDESC;
  306.  
  307. typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
  308.  
  309. typedef struct _DSCBCAPS 
  310. {
  311.     DWORD           dwSize;
  312.     DWORD           dwFlags;
  313.     DWORD           dwBufferBytes;
  314.     DWORD           dwReserved;
  315. } DSCBCAPS, *LPDSCBCAPS;
  316.  
  317. typedef const DSCBCAPS *LPCDSCBCAPS;
  318.  
  319. typedef struct _DSBPOSITIONNOTIFY
  320. {
  321.     DWORD           dwOffset;
  322.     HANDLE          hEventNotify;
  323. } DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY;
  324.  
  325. typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
  326.  
  327. //
  328. // Compatibility typedefs
  329. //
  330.  
  331. typedef LPDIRECTSOUND *LPLPDIRECTSOUND;
  332. typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER;
  333. typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER;
  334. typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER;
  335. typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE;
  336. typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER;
  337. typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY;
  338. typedef LPVOID *LPLPVOID;
  339. typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
  340.  
  341. //
  342. // DirectSound API
  343. //
  344.  
  345. typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID);
  346. typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID);
  347.  
  348. extern HRESULT WINAPI DirectSoundCreate(LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
  349. extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
  350. extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
  351.  
  352. extern HRESULT WINAPI DirectSoundCaptureCreate(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN);
  353. extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
  354. extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
  355.  
  356. #ifdef UNICODE
  357. #define LPDSENUMCALLBACK            LPDSENUMCALLBACKW
  358. #define DirectSoundEnumerate        DirectSoundEnumerateW
  359. #define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW
  360. #else // UNICODE
  361. #define LPDSENUMCALLBACK            LPDSENUMCALLBACKA
  362. #define DirectSoundEnumerate        DirectSoundEnumerateA
  363. #define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA
  364. #endif // UNICODE
  365.  
  366. //
  367. // IDirectSound
  368. //
  369.  
  370. DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  371.  
  372. #undef INTERFACE
  373. #define INTERFACE IDirectSound
  374.  
  375. DECLARE_INTERFACE_(IDirectSound, IUnknown)
  376. {
  377.     // IUnknown methods
  378.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  379.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  380.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  381.     
  382.     // IDirectSound methods
  383.     STDMETHOD(CreateSoundBuffer)    (THIS_ LPCDSBUFFERDESC, LPDIRECTSOUNDBUFFER *, LPUNKNOWN) PURE;
  384.     STDMETHOD(GetCaps)              (THIS_ LPDSCAPS) PURE;
  385.     STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER, LPDIRECTSOUNDBUFFER *) PURE;
  386.     STDMETHOD(SetCooperativeLevel)  (THIS_ HWND, DWORD) PURE;
  387.     STDMETHOD(Compact)              (THIS) PURE;
  388.     STDMETHOD(GetSpeakerConfig)     (THIS_ LPDWORD) PURE;
  389.     STDMETHOD(SetSpeakerConfig)     (THIS_ DWORD) PURE;
  390.     STDMETHOD(Initialize)           (THIS_ LPGUID) PURE;
  391. };
  392.  
  393. #if !defined(__cplusplus) || defined(CINTERFACE)
  394. #define IDirectSound_QueryInterface(p,a,b)       (p)->lpVtbl->QueryInterface(p,a,b)
  395. #define IDirectSound_AddRef(p)                   (p)->lpVtbl->AddRef(p)
  396. #define IDirectSound_Release(p)                  (p)->lpVtbl->Release(p)
  397. #define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
  398. #define IDirectSound_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
  399. #define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
  400. #define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
  401. #define IDirectSound_Compact(p)                  (p)->lpVtbl->Compact(p)
  402. #define IDirectSound_GetSpeakerConfig(p,a)       (p)->lpVtbl->GetSpeakerConfig(p,a)
  403. #define IDirectSound_SetSpeakerConfig(p,b)       (p)->lpVtbl->SetSpeakerConfig(p,b)
  404. #define IDirectSound_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
  405. #else // !defined(__cplusplus) || defined(CINTERFACE)
  406. #define IDirectSound_QueryInterface(p,a,b)       (p)->QueryInterface(a,b)
  407. #define IDirectSound_AddRef(p)                   (p)->AddRef()
  408. #define IDirectSound_Release(p)                  (p)->Release()
  409. #define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->CreateSoundBuffer(a,b,c)
  410. #define IDirectSound_GetCaps(p,a)                (p)->GetCaps(a)
  411. #define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
  412. #define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
  413. #define IDirectSound_Compact(p)                  (p)->Compact()
  414. #define IDirectSound_GetSpeakerConfig(p,a)       (p)->GetSpeakerConfig(a)
  415. #define IDirectSound_SetSpeakerConfig(p,b)       (p)->SetSpeakerConfig(b)
  416. #define IDirectSound_Initialize(p,a)             (p)->Initialize(a)
  417. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  418.  
  419. //
  420. // IDirectSoundBuffer
  421. //
  422.  
  423. DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  424.  
  425. #undef INTERFACE
  426. #define INTERFACE IDirectSoundBuffer
  427.  
  428. DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
  429. {
  430.     // IUnknown methods
  431.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  432.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  433.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  434.     
  435.     // IDirectSoundBuffer methods
  436.     STDMETHOD(GetCaps)              (THIS_ LPDSBCAPS) PURE;
  437.     STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD, LPDWORD) PURE;
  438.     STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE;
  439.     STDMETHOD(GetVolume)            (THIS_ LPLONG) PURE;
  440.     STDMETHOD(GetPan)               (THIS_ LPLONG) PURE;
  441.     STDMETHOD(GetFrequency)         (THIS_ LPDWORD) PURE;
  442.     STDMETHOD(GetStatus)            (THIS_ LPDWORD) PURE;
  443.     STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUND, LPCDSBUFFERDESC) PURE;
  444.     STDMETHOD(Lock)                 (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
  445.     STDMETHOD(Play)                 (THIS_ DWORD, DWORD, DWORD) PURE;
  446.     STDMETHOD(SetCurrentPosition)   (THIS_ DWORD) PURE;
  447.     STDMETHOD(SetFormat)            (THIS_ LPCWAVEFORMATEX) PURE;
  448.     STDMETHOD(SetVolume)            (THIS_ LONG) PURE;
  449.     STDMETHOD(SetPan)               (THIS_ LONG) PURE;
  450.     STDMETHOD(SetFrequency)         (THIS_ DWORD) PURE;
  451.     STDMETHOD(Stop)                 (THIS) PURE;
  452.     STDMETHOD(Unlock)               (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
  453.     STDMETHOD(Restore)              (THIS) PURE;
  454. };
  455.  
  456. #if !defined(__cplusplus) || defined(CINTERFACE)
  457. #define IDirectSoundBuffer_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
  458. #define IDirectSoundBuffer_AddRef(p)                    (p)->lpVtbl->AddRef(p)
  459. #define IDirectSoundBuffer_Release(p)                   (p)->lpVtbl->Release(p)
  460. #define IDirectSoundBuffer_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
  461. #define IDirectSoundBuffer_GetCurrentPosition(p,a,b)    (p)->lpVtbl->GetCurrentPosition(p,a,b)
  462. #define IDirectSoundBuffer_GetFormat(p,a,b,c)           (p)->lpVtbl->GetFormat(p,a,b,c)
  463. #define IDirectSoundBuffer_GetVolume(p,a)               (p)->lpVtbl->GetVolume(p,a)
  464. #define IDirectSoundBuffer_GetPan(p,a)                  (p)->lpVtbl->GetPan(p,a)
  465. #define IDirectSoundBuffer_GetFrequency(p,a)            (p)->lpVtbl->GetFrequency(p,a)
  466. #define IDirectSoundBuffer_GetStatus(p,a)               (p)->lpVtbl->GetStatus(p,a)
  467. #define IDirectSoundBuffer_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
  468. #define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
  469. #define IDirectSoundBuffer_Play(p,a,b,c)                (p)->lpVtbl->Play(p,a,b,c)
  470. #define IDirectSoundBuffer_SetCurrentPosition(p,a)      (p)->lpVtbl->SetCurrentPosition(p,a)
  471. #define IDirectSoundBuffer_SetFormat(p,a)               (p)->lpVtbl->SetFormat(p,a)
  472. #define IDirectSoundBuffer_SetVolume(p,a)               (p)->lpVtbl->SetVolume(p,a)
  473. #define IDirectSoundBuffer_SetPan(p,a)                  (p)->lpVtbl->SetPan(p,a)
  474. #define IDirectSoundBuffer_SetFrequency(p,a)            (p)->lpVtbl->SetFrequency(p,a)
  475. #define IDirectSoundBuffer_Stop(p)                      (p)->lpVtbl->Stop(p)
  476. #define IDirectSoundBuffer_Unlock(p,a,b,c,d)            (p)->lpVtbl->Unlock(p,a,b,c,d)
  477. #define IDirectSoundBuffer_Restore(p)                   (p)->lpVtbl->Restore(p)
  478. #else // !defined(__cplusplus) || defined(CINTERFACE)
  479. #define IDirectSoundBuffer_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
  480. #define IDirectSoundBuffer_AddRef(p)                    (p)->AddRef()
  481. #define IDirectSoundBuffer_Release(p)                   (p)->Release()
  482. #define IDirectSoundBuffer_GetCaps(p,a)                 (p)->GetCaps(a)
  483. #define IDirectSoundBuffer_GetCurrentPosition(p,a,b)    (p)->GetCurrentPosition(a,b)
  484. #define IDirectSoundBuffer_GetFormat(p,a,b,c)           (p)->GetFormat(a,b,c)
  485. #define IDirectSoundBuffer_GetVolume(p,a)               (p)->GetVolume(a)
  486. #define IDirectSoundBuffer_GetPan(p,a)                  (p)->GetPan(a)
  487. #define IDirectSoundBuffer_GetFrequency(p,a)            (p)->GetFrequency(a)
  488. #define IDirectSoundBuffer_GetStatus(p,a)               (p)->GetStatus(a)
  489. #define IDirectSoundBuffer_Initialize(p,a,b)            (p)->Initialize(a,b)
  490. #define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->Lock(a,b,c,d,e,f,g)
  491. #define IDirectSoundBuffer_Play(p,a,b,c)                (p)->Play(a,b,c)
  492. #define IDirectSoundBuffer_SetCurrentPosition(p,a)      (p)->SetCurrentPosition(a)
  493. #define IDirectSoundBuffer_SetFormat(p,a)               (p)->SetFormat(a)
  494. #define IDirectSoundBuffer_SetVolume(p,a)               (p)->SetVolume(a)
  495. #define IDirectSoundBuffer_SetPan(p,a)                  (p)->SetPan(a)
  496. #define IDirectSoundBuffer_SetFrequency(p,a)            (p)->SetFrequency(a)
  497. #define IDirectSoundBuffer_Stop(p)                      (p)->Stop()
  498. #define IDirectSoundBuffer_Unlock(p,a,b,c,d)            (p)->Unlock(a,b,c,d)
  499. #define IDirectSoundBuffer_Restore(p)                   (p)->Restore()
  500. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  501.  
  502. //
  503. // IDirectSound3DListener
  504. //
  505.  
  506. DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  507.  
  508. #undef INTERFACE
  509. #define INTERFACE IDirectSound3DListener
  510.  
  511. DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown)
  512. {
  513.     // IUnknown methods
  514.     STDMETHOD(QueryInterface)           (THIS_ REFIID, LPVOID FAR *) PURE;
  515.     STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
  516.     STDMETHOD_(ULONG,Release)           (THIS) PURE;
  517.  
  518.     // IDirectSound3D methods
  519.     STDMETHOD(GetAllParameters)         (THIS_ LPDS3DLISTENER) PURE;
  520.     STDMETHOD(GetDistanceFactor)        (THIS_ LPD3DVALUE) PURE;
  521.     STDMETHOD(GetDopplerFactor)         (THIS_ LPD3DVALUE) PURE;
  522.     STDMETHOD(GetOrientation)           (THIS_ LPD3DVECTOR, LPD3DVECTOR) PURE;
  523.     STDMETHOD(GetPosition)              (THIS_ LPD3DVECTOR) PURE;
  524.     STDMETHOD(GetRolloffFactor)         (THIS_ LPD3DVALUE) PURE;
  525.     STDMETHOD(GetVelocity)              (THIS_ LPD3DVECTOR) PURE;
  526.     STDMETHOD(SetAllParameters)         (THIS_ LPCDS3DLISTENER, DWORD) PURE;
  527.     STDMETHOD(SetDistanceFactor)        (THIS_ D3DVALUE, DWORD) PURE;
  528.     STDMETHOD(SetDopplerFactor)         (THIS_ D3DVALUE, DWORD) PURE;
  529.     STDMETHOD(SetOrientation)           (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  530.     STDMETHOD(SetPosition)              (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  531.     STDMETHOD(SetRolloffFactor)         (THIS_ D3DVALUE, DWORD) PURE;
  532.     STDMETHOD(SetVelocity)              (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  533.     STDMETHOD(CommitDeferredSettings)   (THIS) PURE;
  534. };
  535.  
  536. #if !defined(__cplusplus) || defined(CINTERFACE)
  537. #define IDirectSound3DListener_QueryInterface(p,a,b)            (p)->lpVtbl->QueryInterface(p,a,b)
  538. #define IDirectSound3DListener_AddRef(p)                        (p)->lpVtbl->AddRef(p)
  539. #define IDirectSound3DListener_Release(p)                       (p)->lpVtbl->Release(p)
  540. #define IDirectSound3DListener_GetAllParameters(p,a)            (p)->lpVtbl->GetAllParameters(p,a)
  541. #define IDirectSound3DListener_GetDistanceFactor(p,a)           (p)->lpVtbl->GetDistanceFactor(p,a)
  542. #define IDirectSound3DListener_GetDopplerFactor(p,a)            (p)->lpVtbl->GetDopplerFactor(p,a)
  543. #define IDirectSound3DListener_GetOrientation(p,a,b)            (p)->lpVtbl->GetOrientation(p,a,b)
  544. #define IDirectSound3DListener_GetPosition(p,a)                 (p)->lpVtbl->GetPosition(p,a)
  545. #define IDirectSound3DListener_GetRolloffFactor(p,a)            (p)->lpVtbl->GetRolloffFactor(p,a)
  546. #define IDirectSound3DListener_GetVelocity(p,a)                 (p)->lpVtbl->GetVelocity(p,a)
  547. #define IDirectSound3DListener_SetAllParameters(p,a,b)          (p)->lpVtbl->SetAllParameters(p,a,b)
  548. #define IDirectSound3DListener_SetDistanceFactor(p,a,b)         (p)->lpVtbl->SetDistanceFactor(p,a,b)
  549. #define IDirectSound3DListener_SetDopplerFactor(p,a,b)          (p)->lpVtbl->SetDopplerFactor(p,a,b)
  550. #define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g)  (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
  551. #define IDirectSound3DListener_SetPosition(p,a,b,c,d)           (p)->lpVtbl->SetPosition(p,a,b,c,d)
  552. #define IDirectSound3DListener_SetRolloffFactor(p,a,b)          (p)->lpVtbl->SetRolloffFactor(p,a,b)
  553. #define IDirectSound3DListener_SetVelocity(p,a,b,c,d)           (p)->lpVtbl->SetVelocity(p,a,b,c,d)
  554. #define IDirectSound3DListener_CommitDeferredSettings(p)        (p)->lpVtbl->CommitDeferredSettings(p)
  555. #else // !defined(__cplusplus) || defined(CINTERFACE)
  556. #define IDirectSound3DListener_QueryInterface(p,a,b)            (p)->QueryInterface(a,b)
  557. #define IDirectSound3DListener_AddRef(p)                        (p)->AddRef()
  558. #define IDirectSound3DListener_Release(p)                       (p)->Release()
  559. #define IDirectSound3DListener_GetAllParameters(p,a)            (p)->GetAllParameters(a)
  560. #define IDirectSound3DListener_GetDistanceFactor(p,a)           (p)->GetDistanceFactor(a)
  561. #define IDirectSound3DListener_GetDopplerFactor(p,a)            (p)->GetDopplerFactor(a)
  562. #define IDirectSound3DListener_GetOrientation(p,a,b)            (p)->GetOrientation(a,b)
  563. #define IDirectSound3DListener_GetPosition(p,a)                 (p)->GetPosition(a)
  564. #define IDirectSound3DListener_GetRolloffFactor(p,a)            (p)->GetRolloffFactor(a)
  565. #define IDirectSound3DListener_GetVelocity(p,a)                 (p)->GetVelocity(a)
  566. #define IDirectSound3DListener_SetAllParameters(p,a,b)          (p)->SetAllParameters(a,b)
  567. #define IDirectSound3DListener_SetDistanceFactor(p,a,b)         (p)->SetDistanceFactor(a,b)
  568. #define IDirectSound3DListener_SetDopplerFactor(p,a,b)          (p)->SetDopplerFactor(a,b)
  569. #define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g)  (p)->SetOrientation(a,b,c,d,e,f,g)
  570. #define IDirectSound3DListener_SetPosition(p,a,b,c,d)           (p)->SetPosition(a,b,c,d)
  571. #define IDirectSound3DListener_SetRolloffFactor(p,a,b)          (p)->SetRolloffFactor(a,b)
  572. #define IDirectSound3DListener_SetVelocity(p,a,b,c,d)           (p)->SetVelocity(a,b,c,d)
  573. #define IDirectSound3DListener_CommitDeferredSettings(p)        (p)->CommitDeferredSettings()
  574. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  575.  
  576. //
  577. // IDirectSound3DBuffer
  578. //
  579.  
  580. DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  581.  
  582. #undef INTERFACE
  583. #define INTERFACE IDirectSound3DBuffer
  584.  
  585. DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown)
  586. {
  587.     // IUnknown methods
  588.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  589.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  590.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  591.  
  592.     // IDirectSoundBuffer3D methods
  593.     STDMETHOD(GetAllParameters)     (THIS_ LPDS3DBUFFER) PURE;
  594.     STDMETHOD(GetConeAngles)        (THIS_ LPDWORD, LPDWORD) PURE;
  595.     STDMETHOD(GetConeOrientation)   (THIS_ LPD3DVECTOR) PURE;
  596.     STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG) PURE;
  597.     STDMETHOD(GetMaxDistance)       (THIS_ LPD3DVALUE) PURE;
  598.     STDMETHOD(GetMinDistance)       (THIS_ LPD3DVALUE) PURE;
  599.     STDMETHOD(GetMode)              (THIS_ LPDWORD) PURE;
  600.     STDMETHOD(GetPosition)          (THIS_ LPD3DVECTOR) PURE;
  601.     STDMETHOD(GetVelocity)          (THIS_ LPD3DVECTOR) PURE;
  602.     STDMETHOD(SetAllParameters)     (THIS_ LPCDS3DBUFFER, DWORD) PURE;
  603.     STDMETHOD(SetConeAngles)        (THIS_ DWORD, DWORD, DWORD) PURE;
  604.     STDMETHOD(SetConeOrientation)   (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  605.     STDMETHOD(SetConeOutsideVolume) (THIS_ LONG, DWORD) PURE;
  606.     STDMETHOD(SetMaxDistance)       (THIS_ D3DVALUE, DWORD) PURE;
  607.     STDMETHOD(SetMinDistance)       (THIS_ D3DVALUE, DWORD) PURE;
  608.     STDMETHOD(SetMode)              (THIS_ DWORD, DWORD) PURE;
  609.     STDMETHOD(SetPosition)          (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  610.     STDMETHOD(SetVelocity)          (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  611. };
  612.  
  613. #if !defined(__cplusplus) || defined(CINTERFACE)
  614. #define IDirectSound3DBuffer_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
  615. #define IDirectSound3DBuffer_AddRef(p)                  (p)->lpVtbl->AddRef(p)
  616. #define IDirectSound3DBuffer_Release(p)                 (p)->lpVtbl->Release(p)
  617. #define IDirectSound3DBuffer_GetAllParameters(p,a)      (p)->lpVtbl->GetAllParameters(p,a)
  618. #define IDirectSound3DBuffer_GetConeAngles(p,a,b)       (p)->lpVtbl->GetConeAngles(p,a,b)
  619. #define IDirectSound3DBuffer_GetConeOrientation(p,a)    (p)->lpVtbl->GetConeOrientation(p,a)
  620. #define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)  (p)->lpVtbl->GetConeOutsideVolume(p,a)
  621. #define IDirectSound3DBuffer_GetPosition(p,a)           (p)->lpVtbl->GetPosition(p,a)
  622. #define IDirectSound3DBuffer_GetMinDistance(p,a)        (p)->lpVtbl->GetMinDistance(p,a)
  623. #define IDirectSound3DBuffer_GetMaxDistance(p,a)        (p)->lpVtbl->GetMaxDistance(p,a)
  624. #define IDirectSound3DBuffer_GetMode(p,a)               (p)->lpVtbl->GetMode(p,a)
  625. #define IDirectSound3DBuffer_GetVelocity(p,a)           (p)->lpVtbl->GetVelocity(p,a)
  626. #define IDirectSound3DBuffer_SetAllParameters(p,a,b)    (p)->lpVtbl->SetAllParameters(p,a,b)
  627. #define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)     (p)->lpVtbl->SetConeAngles(p,a,b,c)
  628. #define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
  629. #define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->lpVtbl->SetConeOutsideVolume(p,a,b)
  630. #define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)     (p)->lpVtbl->SetPosition(p,a,b,c,d)
  631. #define IDirectSound3DBuffer_SetMinDistance(p,a,b)      (p)->lpVtbl->SetMinDistance(p,a,b)
  632. #define IDirectSound3DBuffer_SetMaxDistance(p,a,b)      (p)->lpVtbl->SetMaxDistance(p,a,b)
  633. #define IDirectSound3DBuffer_SetMode(p,a,b)             (p)->lpVtbl->SetMode(p,a,b)
  634. #define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)     (p)->lpVtbl->SetVelocity(p,a,b,c,d)
  635. #else // !defined(__cplusplus) || defined(CINTERFACE)
  636. #define IDirectSound3DBuffer_QueryInterface(p,a,b)      (p)->QueryInterface(a,b)
  637. #define IDirectSound3DBuffer_AddRef(p)                  (p)->AddRef()
  638. #define IDirectSound3DBuffer_Release(p)                 (p)->Release()
  639. #define IDirectSound3DBuffer_GetAllParameters(p,a)      (p)->GetAllParameters(a)
  640. #define IDirectSound3DBuffer_GetConeAngles(p,a,b)       (p)->GetConeAngles(a,b)
  641. #define IDirectSound3DBuffer_GetConeOrientation(p,a)    (p)->GetConeOrientation(a)
  642. #define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)  (p)->GetConeOutsideVolume(a)
  643. #define IDirectSound3DBuffer_GetPosition(p,a)           (p)->GetPosition(a)
  644. #define IDirectSound3DBuffer_GetMinDistance(p,a)        (p)->GetMinDistance(a)
  645. #define IDirectSound3DBuffer_GetMaxDistance(p,a)        (p)->GetMaxDistance(a)
  646. #define IDirectSound3DBuffer_GetMode(p,a)               (p)->GetMode(a)
  647. #define IDirectSound3DBuffer_GetVelocity(p,a)           (p)->GetVelocity(a)
  648. #define IDirectSound3DBuffer_SetAllParameters(p,a,b)    (p)->SetAllParameters(a,b)
  649. #define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)     (p)->SetConeAngles(a,b,c)
  650. #define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d)
  651. #define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->SetConeOutsideVolume(a,b)
  652. #define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)     (p)->SetPosition(a,b,c,d)
  653. #define IDirectSound3DBuffer_SetMinDistance(p,a,b)      (p)->SetMinDistance(a,b)
  654. #define IDirectSound3DBuffer_SetMaxDistance(p,a,b)      (p)->SetMaxDistance(a,b)
  655. #define IDirectSound3DBuffer_SetMode(p,a,b)             (p)->SetMode(a,b)
  656. #define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)     (p)->SetVelocity(a,b,c,d)
  657. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  658.  
  659. //
  660. // IDirectSoundCapture
  661. //
  662.  
  663. DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  664.  
  665. #undef INTERFACE
  666. #define INTERFACE IDirectSoundCapture
  667.  
  668. DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown)
  669. {
  670.     // IUnknown methods
  671.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  672.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  673.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  674.  
  675.     // IDirectSoundCapture methods
  676.     STDMETHOD(CreateCaptureBuffer)  (THIS_ LPCDSCBUFFERDESC, LPDIRECTSOUNDCAPTUREBUFFER *, LPUNKNOWN) PURE;
  677.     STDMETHOD(GetCaps)              (THIS_ LPDSCCAPS ) PURE;
  678.     STDMETHOD(Initialize)           (THIS_ LPGUID) PURE;
  679. };
  680.  
  681. #if !defined(__cplusplus) || defined(CINTERFACE)
  682. #define IDirectSoundCapture_QueryInterface(p,a,b)           (p)->lpVtbl->QueryInterface(p,a,b)
  683. #define IDirectSoundCapture_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  684. #define IDirectSoundCapture_Release(p)                      (p)->lpVtbl->Release(p)
  685. #define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c)    (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
  686. #define IDirectSoundCapture_GetCaps(p,a)                    (p)->lpVtbl->GetCaps(p,a)
  687. #define IDirectSoundCapture_Initialize(p,a)                 (p)->lpVtbl->Initialize(p,a)
  688. #else // !defined(__cplusplus) || defined(CINTERFACE)
  689. #define IDirectSoundCapture_QueryInterface(p,a,b)           (p)->QueryInterface(a,b)
  690. #define IDirectSoundCapture_AddRef(p)                       (p)->AddRef()
  691. #define IDirectSoundCapture_Release(p)                      (p)->Release()
  692. #define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c)    (p)->CreateCaptureBuffer(a,b,c)
  693. #define IDirectSoundCapture_GetCaps(p,a)                    (p)->GetCaps(a)
  694. #define IDirectSoundCapture_Initialize(p,a)                 (p)->Initialize(a)
  695. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  696.  
  697. //
  698. // IDirectSoundCaptureBuffer
  699. //
  700.  
  701. DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  702.  
  703. #undef INTERFACE
  704. #define INTERFACE IDirectSoundCaptureBuffer
  705.  
  706. DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
  707. {
  708.     // IUnknown methods
  709.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  710.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  711.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  712.  
  713.     // IDirectSoundCaptureBuffer methods
  714.     STDMETHOD(GetCaps)              (THIS_ LPDSCBCAPS ) PURE;
  715.     STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD, LPDWORD ) PURE;
  716.     STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) PURE;
  717.     STDMETHOD(GetStatus)            (THIS_ LPDWORD ) PURE;
  718.     STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUNDCAPTURE, LPCDSCBUFFERDESC) PURE;
  719.     STDMETHOD(Lock)                 (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
  720.     STDMETHOD(Start)                (THIS_ DWORD) PURE;
  721.     STDMETHOD(Stop)                 (THIS) PURE;
  722.     STDMETHOD(Unlock)               (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
  723. };
  724.  
  725. #if !defined(__cplusplus) || defined(CINTERFACE)
  726. #define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
  727. #define IDirectSoundCaptureBuffer_AddRef(p)                    (p)->lpVtbl->AddRef(p)
  728. #define IDirectSoundCaptureBuffer_Release(p)                   (p)->lpVtbl->Release(p)
  729. #define IDirectSoundCaptureBuffer_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
  730. #define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)    (p)->lpVtbl->GetCurrentPosition(p,a,b)
  731. #define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)           (p)->lpVtbl->GetFormat(p,a,b,c)
  732. #define IDirectSoundCaptureBuffer_GetStatus(p,a)               (p)->lpVtbl->GetStatus(p,a)
  733. #define IDirectSoundCaptureBuffer_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
  734. #define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
  735. #define IDirectSoundCaptureBuffer_Start(p,a)                   (p)->lpVtbl->Start(p,a)
  736. #define IDirectSoundCaptureBuffer_Stop(p)                      (p)->lpVtbl->Stop(p)
  737. #define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)            (p)->lpVtbl->Unlock(p,a,b,c,d)
  738. #else // !defined(__cplusplus) || defined(CINTERFACE)
  739. #define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
  740. #define IDirectSoundCaptureBuffer_AddRef(p)                    (p)->AddRef()
  741. #define IDirectSoundCaptureBuffer_Release(p)                   (p)->Release()
  742. #define IDirectSoundCaptureBuffer_GetCaps(p,a)                 (p)->GetCaps(a)
  743. #define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)    (p)->GetCurrentPosition(a,b)
  744. #define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)           (p)->GetFormat(a,b,c)
  745. #define IDirectSoundCaptureBuffer_GetStatus(p,a)               (p)->GetStatus(a)
  746. #define IDirectSoundCaptureBuffer_Initialize(p,a,b)            (p)->Initialize(a,b)
  747. #define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->Lock(a,b,c,d,e,f,g)
  748. #define IDirectSoundCaptureBuffer_Start(p,a)                   (p)->Start(a)
  749. #define IDirectSoundCaptureBuffer_Stop(p)                      (p)->Stop()
  750. #define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)            (p)->Unlock(a,b,c,d)
  751. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  752.  
  753. //
  754. // IDirectSoundNotify
  755. //
  756.  
  757. DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  758.  
  759. #undef INTERFACE
  760. #define INTERFACE IDirectSoundNotify
  761.  
  762. DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown)
  763. {
  764.     // IUnknown methods
  765.     STDMETHOD(QueryInterface)           (THIS_ REFIID, LPVOID *) PURE;
  766.     STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
  767.     STDMETHOD_(ULONG,Release)           (THIS) PURE;
  768.  
  769.     // IDirectSoundNotify methods
  770.     STDMETHOD(SetNotificationPositions) (THIS_ DWORD, LPCDSBPOSITIONNOTIFY) PURE;
  771. };
  772.  
  773. #if !defined(__cplusplus) || defined(CINTERFACE)
  774. #define IDirectSoundNotify_QueryInterface(p,a,b)            (p)->lpVtbl->QueryInterface(p,a,b)
  775. #define IDirectSoundNotify_AddRef(p)                        (p)->lpVtbl->AddRef(p)
  776. #define IDirectSoundNotify_Release(p)                       (p)->lpVtbl->Release(p)
  777. #define IDirectSoundNotify_SetNotificationPositions(p,a,b)  (p)->lpVtbl->SetNotificationPositions(p,a,b)
  778. #else // !defined(__cplusplus) || defined(CINTERFACE)
  779. #define IDirectSoundNotify_QueryInterface(p,a,b)            (p)->QueryInterface(a,b)
  780. #define IDirectSoundNotify_AddRef(p)                        (p)->AddRef()
  781. #define IDirectSoundNotify_Release(p)                       (p)->Release()
  782. #define IDirectSoundNotify_SetNotificationPositions(p,a,b)  (p)->SetNotificationPositions(a,b)
  783. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  784.  
  785. //
  786. // IKsPropertySet
  787. //
  788.  
  789. #ifndef _IKsPropertySet_
  790. #define _IKsPropertySet_
  791.  
  792. #ifdef __cplusplus
  793. // 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
  794. struct IKsPropertySet;
  795. #endif // __cplusplus
  796.  
  797. typedef struct IKsPropertySet *LPKSPROPERTYSET;
  798.  
  799. #define KSPROPERTY_SUPPORT_GET  0x00000001
  800. #define KSPROPERTY_SUPPORT_SET  0x00000002
  801.  
  802. DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
  803.  
  804. #undef INTERFACE
  805. #define INTERFACE IKsPropertySet
  806.  
  807. DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
  808. {
  809.     // IUnknown methods
  810.     STDMETHOD(QueryInterface)   (THIS_ REFIID, LPVOID *) PURE;
  811.     STDMETHOD_(ULONG,AddRef)    (THIS) PURE;
  812.     STDMETHOD_(ULONG,Release)   (THIS) PURE;
  813.  
  814.     // IKsPropertySet methods
  815.     STDMETHOD(Get)              (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG, PULONG) PURE;
  816.     STDMETHOD(Set)              (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG) PURE;
  817.     STDMETHOD(QuerySupport)     (THIS_ REFGUID, ULONG, PULONG) PURE;
  818. };
  819.  
  820. #if !defined(__cplusplus) || defined(CINTERFACE)
  821. #define IKsPropertySet_QueryInterface(p,a,b)       (p)->lpVtbl->QueryInterface(p,a,b)
  822. #define IKsPropertySet_AddRef(p)                   (p)->lpVtbl->AddRef(p)
  823. #define IKsPropertySet_Release(p)                  (p)->lpVtbl->Release(p)
  824. #define IKsPropertySet_Get(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
  825. #define IKsPropertySet_Set(p,a,b,c,d,e,f)          (p)->lpVtbl->Set(p,a,b,c,d,e,f)
  826. #define IKsPropertySet_QuerySupport(p,a,b,c)       (p)->lpVtbl->QuerySupport(p,a,b,c)
  827. #else // !defined(__cplusplus) || defined(CINTERFACE)
  828. #define IKsPropertySet_QueryInterface(p,a,b)       (p)->QueryInterface(a,b)
  829. #define IKsPropertySet_AddRef(p)                   (p)->AddRef()
  830. #define IKsPropertySet_Release(p)                  (p)->Release()
  831. #define IKsPropertySet_Get(p,a,b,c,d,e,f,g)        (p)->Get(a,b,c,d,e,f,g)
  832. #define IKsPropertySet_Set(p,a,b,c,d,e,f)          (p)->Set(a,b,c,d,e,f)
  833. #define IKsPropertySet_QuerySupport(p,a,b,c)       (p)->QuerySupport(a,b,c)
  834. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  835.  
  836. #endif // _IKsPropertySet_
  837.  
  838. //
  839. // Return Codes
  840. //
  841.  
  842. #define DS_OK                           0
  843.  
  844. // The call failed because resources (such as a priority level)
  845. // were already being used by another caller.
  846. #define DSERR_ALLOCATED                 MAKE_DSHRESULT(10)
  847.  
  848. // The control (vol,pan,etc.) requested by the caller is not available.
  849. #define DSERR_CONTROLUNAVAIL            MAKE_DSHRESULT(30)
  850.  
  851. // An invalid parameter was passed to the returning function
  852. #define DSERR_INVALIDPARAM              E_INVALIDARG
  853.  
  854. // This call is not valid for the current state of this object
  855. #define DSERR_INVALIDCALL               MAKE_DSHRESULT(50)
  856.  
  857. // An undetermined error occured inside the DirectSound subsystem
  858. #define DSERR_GENERIC                   E_FAIL
  859.  
  860. // The caller does not have the priority level required for the function to
  861. // succeed.
  862. #define DSERR_PRIOLEVELNEEDED           MAKE_DSHRESULT(70)
  863.  
  864. // Not enough free memory is available to complete the operation
  865. #define DSERR_OUTOFMEMORY               E_OUTOFMEMORY
  866.  
  867. // The specified WAVE format is not supported
  868. #define DSERR_BADFORMAT                 MAKE_DSHRESULT(100)
  869.  
  870. // The function called is not supported at this time
  871. #define DSERR_UNSUPPORTED               E_NOTIMPL
  872.  
  873. // No sound driver is available for use
  874. #define DSERR_NODRIVER                  MAKE_DSHRESULT(120)
  875.  
  876. // This object is already initialized
  877. #define DSERR_ALREADYINITIALIZED        MAKE_DSHRESULT(130)
  878.  
  879. // This object does not support aggregation
  880. #define DSERR_NOAGGREGATION             CLASS_E_NOAGGREGATION
  881.  
  882. // The buffer memory has been lost, and must be restored.
  883. #define DSERR_BUFFERLOST                MAKE_DSHRESULT(150)
  884.  
  885. // Another app has a higher priority level, preventing this call from
  886. // succeeding.
  887. #define DSERR_OTHERAPPHASPRIO           MAKE_DSHRESULT(160)
  888.  
  889. // This object has not been initialized
  890. #define DSERR_UNINITIALIZED             MAKE_DSHRESULT(170)
  891.  
  892. // The requested COM interface is not available
  893. #define DSERR_NOINTERFACE               E_NOINTERFACE
  894.  
  895. //
  896. // Flags
  897. //
  898.  
  899. #define DSCAPS_PRIMARYMONO          0x00000001
  900. #define DSCAPS_PRIMARYSTEREO        0x00000002
  901. #define DSCAPS_PRIMARY8BIT          0x00000004
  902. #define DSCAPS_PRIMARY16BIT         0x00000008
  903. #define DSCAPS_CONTINUOUSRATE       0x00000010
  904. #define DSCAPS_EMULDRIVER           0x00000020
  905. #define DSCAPS_CERTIFIED            0x00000040
  906. #define DSCAPS_SECONDARYMONO        0x00000100
  907. #define DSCAPS_SECONDARYSTEREO      0x00000200
  908. #define DSCAPS_SECONDARY8BIT        0x00000400
  909. #define DSCAPS_SECONDARY16BIT       0x00000800
  910.  
  911. #define DSBPLAY_LOOPING             0x00000001
  912.       
  913. #define DSBSTATUS_PLAYING           0x00000001
  914. #define DSBSTATUS_BUFFERLOST        0x00000002
  915. #define DSBSTATUS_LOOPING           0x00000004
  916.  
  917. #define DSBLOCK_FROMWRITECURSOR     0x00000001
  918. #define DSBLOCK_ENTIREBUFFER        0x00000002
  919.  
  920. #define DSSCL_NORMAL                0x00000001
  921. #define DSSCL_PRIORITY              0x00000002
  922. #define DSSCL_EXCLUSIVE             0x00000003
  923. #define DSSCL_WRITEPRIMARY          0x00000004
  924.  
  925. #define DS3DMODE_NORMAL             0x00000000
  926. #define DS3DMODE_HEADRELATIVE       0x00000001
  927. #define DS3DMODE_DISABLE            0x00000002
  928.  
  929. #define DS3D_IMMEDIATE              0x00000000
  930. #define DS3D_DEFERRED               0x00000001
  931.  
  932. #define DS3D_MINDISTANCEFACTOR      0.0f
  933. #define DS3D_MAXDISTANCEFACTOR      10.0f
  934. #define DS3D_DEFAULTDISTANCEFACTOR  1.0f
  935.  
  936. #define DS3D_MINROLLOFFFACTOR       0.0f
  937. #define DS3D_MAXROLLOFFFACTOR       10.0f
  938. #define DS3D_DEFAULTROLLOFFFACTOR   1.0f
  939.  
  940. #define DS3D_MINDOPPLERFACTOR       0.0f
  941. #define DS3D_MAXDOPPLERFACTOR       10.0f
  942. #define DS3D_DEFAULTDOPPLERFACTOR   1.0f
  943.  
  944. #define DS3D_DEFAULTMINDISTANCE     1.0f
  945. #define DS3D_DEFAULTMAXDISTANCE     1000000000.0f
  946.  
  947. #define DS3D_MINCONEANGLE           0
  948. #define DS3D_MAXCONEANGLE           360
  949. #define DS3D_DEFAULTCONEANGLE       360
  950.  
  951. #define DS3D_DEFAULTCONEOUTSIDEVOLUME   0
  952.  
  953. #define DSBCAPS_PRIMARYBUFFER       0x00000001
  954. #define DSBCAPS_STATIC              0x00000002
  955. #define DSBCAPS_LOCHARDWARE         0x00000004
  956. #define DSBCAPS_LOCSOFTWARE         0x00000008
  957. #define DSBCAPS_CTRL3D              0x00000010
  958. #define DSBCAPS_CTRLFREQUENCY       0x00000020
  959. #define DSBCAPS_CTRLPAN             0x00000040
  960. #define DSBCAPS_CTRLVOLUME          0x00000080
  961. #define DSBCAPS_CTRLPOSITIONNOTIFY  0x00000100
  962. #define DSBCAPS_CTRLDEFAULT         0x000000E0
  963. #define DSBCAPS_CTRLALL             0x000001F0
  964. #define DSBCAPS_STICKYFOCUS         0x00004000
  965. #define DSBCAPS_GLOBALFOCUS         0x00008000 
  966. #define DSBCAPS_GETCURRENTPOSITION2 0x00010000
  967. #define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
  968.  
  969. #define DSCBCAPS_WAVEMAPPED         0x80000000
  970.  
  971. #define DSSPEAKER_HEADPHONE         0x00000001
  972. #define DSSPEAKER_MONO              0x00000002
  973. #define DSSPEAKER_QUAD              0x00000003
  974. #define DSSPEAKER_STEREO            0x00000004
  975. #define DSSPEAKER_SURROUND          0x00000005
  976.  
  977. #define DSSPEAKER_GEOMETRY_MIN      0x00000005  //   5 degrees
  978. #define DSSPEAKER_GEOMETRY_NARROW   0x0000000A  //  10 degrees
  979. #define DSSPEAKER_GEOMETRY_WIDE     0x00000014  //  20 degrees
  980. #define DSSPEAKER_GEOMETRY_MAX      0x000000B4  // 180 degrees
  981.  
  982. #define DSSPEAKER_COMBINED(c, g)    ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
  983. #define DSSPEAKER_CONFIG(a)         ((BYTE)(a))
  984. #define DSSPEAKER_GEOMETRY(a)       ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
  985.  
  986. #define DSCCAPS_EMULDRIVER          0x00000020
  987.  
  988. #define DSCBLOCK_ENTIREBUFFER       0x00000001
  989.  
  990. #define DSCBSTATUS_CAPTURING        0x00000001
  991. #define DSCBSTATUS_LOOPING          0x00000002
  992.  
  993. #define DSCBSTART_LOOPING           0x00000001
  994.  
  995. #define DSBFREQUENCY_MIN            100
  996. #define DSBFREQUENCY_MAX            100000
  997. #define DSBFREQUENCY_ORIGINAL       0
  998.  
  999. #define DSBPAN_LEFT                 -10000
  1000. #define DSBPAN_CENTER               0
  1001. #define DSBPAN_RIGHT                10000
  1002.  
  1003. #define DSBVOLUME_MIN               -10000
  1004. #define DSBVOLUME_MAX               0
  1005.  
  1006. #define DSBSIZE_MIN                 4
  1007. #define DSBSIZE_MAX                 0x0FFFFFFF
  1008.  
  1009. #define DSBPN_OFFSETSTOP            0xFFFFFFFF
  1010.  
  1011. #ifdef __cplusplus
  1012. };
  1013. #endif // __cplusplus
  1014.  
  1015. #endif  // __DSOUND_INCLUDED__ 
  1016.